********** Beginning of RDML commands **********
FUNCTION   OPTIONS(*DIRECT)
**********
DEFINE     FIELD(#JSMSTS) TYPE(*CHAR) LENGTH(20)
DEFINE     FIELD(#JSMCMD) TYPE(*CHAR) LENGTH(255)
DEFINE     FIELD(#JSMMSG) TYPE(*CHAR) LENGTH(255)
**********
DEFINE     FIELD(#STRDTE) TYPE(*CHAR) LENGTH(20)
DEFINE     FIELD(#ACTIVE) TYPE(*CHAR) LENGTH(5)
DEFINE     FIELD(#SECRET) TYPE(*CHAR) LENGTH(5)
DEFINE     FIELD(#COUNT) TYPE(*DEC) LENGTH(3) DECIMALS(0)
**********
DEF_LIST   NAME(#WRKLST) FIELDS((#EMPNO) (#SECRET) (#GIVENAME) (#SURNAME) (#SALARY) (#STRDTE) (#ACTIVE)) TYPE(*WORKING)
**********
SELECT     FIELDS((#EMPNO) (#GIVENAME) (#SURNAME) (#SALARY)) FROM_FILE(PSLMST2)
CHANGE     FIELD(#COUNT) TO('#COUNT + 1')
CHANGE     FIELD(#ACTIVE) TO('Y')
CHANGE     FIELD(#SECRET) TO('HIGH')
CHANGE     FIELD(#STRDTE) TO('''2007-03-24''')
IF         COND('#COUNT *EQ 5')
CHANGE     FIELD(#STRDTE) TO(*BLANK)
ENDIF
IF         COND('#COUNT *EQ 8')
CHANGE     FIELD(#SALARY) TO(*ZERO)
ENDIF
ADD_ENTRY  TO_LIST(#WRKLST)
ENDSELECT
**********
USE        BUILTIN(JSM_OPEN) WITH_ARGS('LOCALHOST:7560') TO_GET(#JSMSTS #JSMMSG)
EXECUTE    SUBROUTINE(CHECK) WITH_PARMS(#JSMSTS #JSMMSG)
**********
CHANGE     FIELD(#JSMCMD) TO('SERVICE_LOAD SERVICE(EXCELSERVICE) TRACE(*YES)')
USE        BUILTIN(JSM_COMMAND) WITH_ARGS(#JSMCMD) TO_GET(#JSMSTS #JSMMSG)
EXECUTE    SUBROUTINE(CHECK) WITH_PARMS(#JSMSTS #JSMMSG)
**********
CHANGE     FIELD(#JSMCMD) TO('''CREATE USING(test-input/sample.xlsx)''')
USE        BUILTIN(JSM_COMMAND) WITH_ARGS(#JSMCMD) TO_GET(#JSMSTS #JSMMSG)
**********
USE        BUILTIN(JSM_COMMAND) WITH_ARGS('''ADD OBJECT(*SHEET) SHEET(MyTest)''') TO_GET(#JSMSTS #JSMMSG)
**********
**********
********** COLUMNS 4-5 RANGE 12-15
**********
CHANGE     FIELD(#JSMCMD) TO('ADD OBJECT(*CELLSTYLE) TYPE(*STRING) COLUMN(4,5) RANGE(12,15) FONT(*ARIAL) BOLD(*YES)')
USE        BUILTIN(JSM_COMMAND) WITH_ARGS(#JSMCMD) TO_GET(#JSMSTS #JSMMSG)
EXECUTE    SUBROUTINE(CHECK) WITH_PARMS(#JSMSTS #JSMMSG)
**********
********** COLUMNS 6 RANGE 15-20
**********
CHANGE     FIELD(#JSMCMD) TO('ADD OBJECT(*CELLSTYLE) TYPE(*NUMBER)
            COLUMN(6) RANGE(15,20) FORMAT(#.##;#.##;-) HALIGN(*CENTRE) BACKGROUND(*YELLOW) FONT(*ARIAL) FONTSIZE(15)
            FONTCOLOR(*RED) ITALIC(*YES) BORDER(*ALL) BORDERCOLOR(*BLUE) BORDERSTYLE(*MEDIUM)')
USE        BUILTIN(JSM_COMMAND) WITH_ARGS(#JSMCMD) TO_GET(#JSMSTS #JSMMSG)
EXECUTE    SUBROUTINE(CHECK) WITH_PARMS(#JSMSTS #JSMMSG)
**********
********** COLUMNS 6 RANGE 25-30
**********
CHANGE     FIELD(#JSMCMD) TO('ADD OBJECT(*CELLSTYLE) TYPE(*NUMBER)
            COLUMN(6) RANGE(25,30) FONT(*TAHOMA) BOLD(*YES) FORMAT(*FORMAT5) HALIGN(*RIGHT)')
USE        BUILTIN(JSM_COMMAND) WITH_ARGS(#JSMCMD) TO_GET(#JSMSTS #JSMMSG)
EXECUTE    SUBROUTINE(CHECK) WITH_PARMS(#JSMSTS #JSMMSG)
**********
CHANGE     FIELD(#JSMCMD) TO('ADD OBJECT(*CELLSTYLE) TYPE(*DATE) COLUMN(7) RANGE(12,15) FORMAT(*FORMAT14) BOLD(*YES)')
USE        BUILTIN(JSM_COMMAND) WITH_ARGS(#JSMCMD) TO_GET(#JSMSTS #JSMMSG)
EXECUTE    SUBROUTINE(CHECK) WITH_PARMS(#JSMSTS #JSMMSG)
**********
********** COLUMNS 7 RANGE 20-25
**********
CHANGE     FIELD(#JSMCMD) TO('''ADD OBJECT(*CELLSTYLE) TYPE(*DATE) COLUMN(7) RANGE(20,25) FORMAT(dd mm yyyy) BOLD(*YES)''
           ')
USE        BUILTIN(JSM_COMMAND) WITH_ARGS(#JSMCMD) TO_GET(#JSMSTS #JSMMSG)
EXECUTE    SUBROUTINE(CHECK) WITH_PARMS(#JSMSTS #JSMMSG)
**********
********** COLUMNS 8 RANGE 10-20
**********
CHANGE     FIELD(#JSMCMD) TO('ADD OBJECT(*CELLSTYLE) TYPE(*BOOLEAN) COLUMN(8) RANGE(10,20) FONT(*ARIAL) BOLD(*YES)')
USE        BUILTIN(JSM_COMMAND) WITH_ARGS(#JSMCMD) TO_GET(#JSMSTS #JSMMSG)
EXECUTE    SUBROUTINE(CHECK) WITH_PARMS(#JSMSTS #JSMMSG)
**********
CHANGE     FIELD(#JSMCMD) TO('WRITE R1C1(10,3) SERVICE_LIST(EMPNO,SECRET,GIVENAME,SURNAME,SALARY,STRDTE,ACTIVE) EXCLUDE(S
           ECRET)')
USE        BUILTIN(JSM_COMMAND) WITH_ARGS(#JSMCMD) TO_GET(#JSMSTS #JSMMSG #WRKLST)
EXECUTE    SUBROUTINE(CHECK) WITH_PARMS(#JSMSTS #JSMMSG)
**********
CHANGE     FIELD(#JSMCMD) TO('REMOVE OBJECT(*ROW) RANGE(36,40)')
USE        BUILTIN(JSM_COMMAND) WITH_ARGS(#JSMCMD) TO_GET(#JSMSTS #JSMMSG)
EXECUTE    SUBROUTINE(CHECK) WITH_PARMS(#JSMSTS #JSMMSG)
**********
CHANGE     FIELD(#JSMCMD) TO('''SET OBJECT(*SHEET) DISPLAYGRID(*NO) PRINTGRID(*NO) SELECTED(*YES) PROTECT(*YES) PASSWORD(
           password)''')
USE        BUILTIN(JSM_COMMAND) WITH_ARGS(#JSMCMD) TO_GET(#JSMSTS #JSMMSG)
**********
CHANGE     FIELD(#JSMCMD) TO('SET OBJECT(*COLUMNWIDTH) RANGE(3,5) WIDTH(2560)')
USE        BUILTIN(JSM_COMMAND) WITH_ARGS(#JSMCMD) TO_GET(#JSMSTS #JSMMSG)
**********
CHANGE     FIELD(#JSMCMD) TO('SET OBJECT(*COLUMNWIDTH) RANGE(6,6) WIDTH(11520)')
USE        BUILTIN(JSM_COMMAND) WITH_ARGS(#JSMCMD) TO_GET(#JSMSTS #JSMMSG)
**********
CHANGE     FIELD(#JSMCMD) TO('SET OBJECT(*COLUMNWIDTH) RANGE(7,7) WIDTH(5760)')
USE        BUILTIN(JSM_COMMAND) WITH_ARGS(#JSMCMD) TO_GET(#JSMSTS #JSMMSG)
**********
CHANGE     FIELD(#JSMCMD) TO('REMOVE OBJECT(*COLUMN) SHEET(MYTEST) RANGE(8)')
USE        BUILTIN(JSM_COMMAND) WITH_ARGS(#JSMCMD) TO_GET(#JSMSTS #JSMMSG)
EXECUTE    SUBROUTINE(CHECK) WITH_PARMS(#JSMSTS #JSMMSG)
**********
CHANGE     FIELD(#JSMCMD) TO('''SAVE FILE(test-output/JTSTE16.xlsx)''')
USE        BUILTIN(JSM_COMMAND) WITH_ARGS(#JSMCMD) TO_GET(#JSMSTS #JSMMSG)
EXECUTE    SUBROUTINE(CHECK) WITH_PARMS(#JSMSTS #JSMMSG)
**********
USE        BUILTIN(JSM_COMMAND) WITH_ARGS('CLOSE') TO_GET(#JSMSTS #JSMMSG)
EXECUTE    SUBROUTINE(CHECK) WITH_PARMS(#JSMSTS #JSMMSG)
**********
USE        BUILTIN(JSM_COMMAND) WITH_ARGS('SERVICE_UNLOAD') TO_GET(#JSMSTS #JSMMSG)
EXECUTE    SUBROUTINE(CHECK) WITH_PARMS(#JSMSTS #JSMMSG)
**********
USE        BUILTIN(JSM_CLOSE) TO_GET(#JSMSTS #JSMMSG)
EXECUTE    SUBROUTINE(CHECK) WITH_PARMS(#JSMSTS #JSMMSG)
**********
********** SUB ROUTINES
**********
SUBROUTINE NAME(CHECK) PARMS((#JSMSTS *RECEIVED) (#JSMMSG *RECEIVED))
**********
IF         COND('#JSMSTS *NE OK')
DISPLAY    FIELDS((#JSMSTS) (#JSMMSG))
**********
USE        BUILTIN(JSM_CLOSE) TO_GET(#JSMSTS #JSMMSG)
**********
MENU       MSGTXT('Java service error has occured')
**********
ENDIF
**********
ENDROUTINE
********** End of RDML commands **********